package com.app.newiptv.base;

import android.app.Application;
import android.content.Context;
import android.graphics.Typeface;

import com.app.newiptv.bean.LiveListBean;
import com.app.newiptv.utils.greendao.GreenDaoManager;
import com.lzy.okhttputils.OkHttpUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Shinelon on 2017/9/14.
 */

public class MyApplication extends Application {
    public static MyApplication mApp;
    public static Typeface face;
    public static List<LiveListBean> liveListBeen;
    private static Context context;
    public static final int COLLECTIION = 99999; //收藏
    @Override
    public void onCreate() {
        super.onCreate();
        mApp = this;
        context = getContext();
        liveListBeen = new ArrayList<>();
        face = Typeface.createFromAsset(getApplicationContext().getAssets(), "hei_jian.ttf");
        initGreenDao();
        initOkGo();
    }
    public static Context getContext()
    {
        return context;
    }
    public void initGreenDao() {
        GreenDaoManager.getInstance();
    }

    public void initOkGo() {
        //必须调用初始化
        OkHttpUtils.init(this);
        OkHttpUtils.getInstance().debug("TAG", true);
    }
}
